<template>
  <div class="usercenter">
    <div class="header">
      <div class="header_title">
        <div class="title_avatar" v-if="business.avatar_text">
          <img :src="business.avatar_text" />
        </div>
        <div class="title_avatar" v-else>
          <img src="/assets/images/kongbai.jpg" />
        </div>
        <div class="title_content">
          <div class="content_text">
            <van-button v-if="business.nickname" type="default" disabled color="#ffeccc" id="ziti">{{business.nickname}}</van-button>
            <van-button v-else :to="{path:'/business/login'}" type="default" color="#ffeccc" id="ziti">请先登录</van-button>
          </div>
          <div class="content_sm" v-if="business.mobile_text">{{ business.mobile_text }}</div>
        </div>
      </div>
    </div>
    <div class="userorder">
      <div class="order_project">
        <div class="item">
          <router-link to="/sale" class="item">
            <div class="img"> <img src="/assets/images/retail1.png" alt=""></div>
            分销信息
          </router-link>
        </div>
        <div class="item">
          <router-link to="/sale/business" class="item">
            <div class="img"> <img src="/assets/images/retail2.png" alt=""></div>
            分销会员
          </router-link>
        </div>
        <div class="item">
          <router-link to="/sale/money" class="item">
            <div class="img"> <img src="/assets/images/retail3.png" alt=""></div>
            分销佣金
          </router-link>
        </div>
        <div class="item">
          <router-link to="/coupon" class="item">
            <div class="img"> <img src="/assets/images/coupon.png" alt=""></div>
            优惠列表
          </router-link>
        </div>
        <div class="item solid-left">
          <router-link to="/business/pay" class="item">
            <div class="img"> <img src="/assets/images/recharge2.png" alt=""></div>
            充值中心
          </router-link>
        </div>
      </div>
    </div>
    <div class="usertool">
      <div class="list">
        <div class="item">
          <router-link to="/business/profile">
            <div class="img">
              <img src="/assets/images/profile.png" alt="">
            </div>
            基本资料
          </router-link>
        </div>
        <div class="item" v-if="business.auth == '0'" >
          <router-link to="/business/email" >
            <div class="img"> <img src="/assets/images/email.png" alt=""></div>
            邮箱认证
          </router-link>
        </div>
        <div class="item">
          <router-link to="/address">
            <div class="img"> <img src="/assets/images/address.png" alt=""></div>
            收货地址
          </router-link>
        </div>
        <div class="item">
          <router-link to="/business/record">
            <div class="img">
              <img src="/assets/images/consume.png" alt="">
            </div>
            消费记录
          </router-link>
        </div>
        <div class="item">
          <router-link to="/order">
            <div class="img">
              <img src="/assets/images/recharge2.png" alt="">
            </div>
            我的订单
          </router-link>
        </div>
        <div class="item">
          <router-link to="/share">
            <div class="img">
              <img src="/assets/images/quanbu.png" alt="">
            </div>
            种草分享
          </router-link>
        </div>
        <div class="item">
          <a href="javascript:void(0)" @click="logout">
            <div class="img">
              <img src="/assets/images/returns.png" alt="">
            </div>
            退出登录
          </a>
        </div>
      </div>
    </div>
    <div class="userorder">
      <ul class="proul">
        <li>
          <router-link to="/product/info"><img src="/assets/images/7.jpg" /></router-link>
          <router-link to="/product/info">
            <p class="tit">北欧轻奢餐椅家用现代简约新中式洽谈酒店皮革软包餐厅椅子靠背椅</p>
          </router-link>
          <div class="price">
            <p>￥2998</p>
          </div>
        </li>
        <li>
          <router-link to="/product/info"><img src="/assets/images/4.jpg" /></router-link>
          <router-link to="/product/info">
            <p class="tit">松兰宾利实木餐桌椅组合后现代轻奢长方形大户型不锈钢8人饭桌</p>
          </router-link>
          <div class="price">
            <p>￥998</p>
          </div>
        </li>
        <li>
          <router-link to="/product/info"><img src="/assets/images/5.jpg" /></router-link>
          <router-link to="/product/info">
            <p class="tit">卫生间洗手台柜面池洗睑台式壁挂台盆架瓷盥洗池饭店小号挂盆经济</p>
          </router-link>
          <div class="price">
            <p>￥368</p>
          </div>
        </li>
        <li>
          <router-link to="/product/info"><img src="/assets/images/6.jpg" /></router-link>
          <router-link to="/product/info">
            <p class="tit">布艺床主卧大床双人床港式轻奢ins网红床卧室北欧家具床现代简约</p>
          </router-link>
          <div class="price">
            <p>￥3998</p>
          </div>
        </li>
      </ul>
    </div>

    <Tabbar />
  </div>
</template>

<script setup>

  //获取this对象
  const {proxy} = getCurrentInstance()

  //要引入数据
  let business = proxy.$business
// console.log(business)
  
  let logout = () => 
  {
    proxy.$confirm({
        message: '是否确认退出',
    }).then(() => { //确认
        //退出到登录界面
        proxy.$store.$reset()
        proxy.$router.push('/business/login')
        return
    }).catch(() => {})
  }
</script>

<style scoped>
  @import url('/assets/css/BusinessIndex.css');

  #ziti{
    font-size: 20px;
    font-weight: 1000;
    /* color:brown; */
  }
</style>